﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>千里马ERP欢迎您!!!</title>
    @*<link rel="stylesheet" href="~/css/bootstrap.css" />
        <link rel="stylesheet" href="~/css/css.css" />
        <link href="~/Content/Site.css" rel="stylesheet" />
        <script type="text/javascript" src="~/js/jquery1.9.0.min.js"></script>
        <script type="text/javascript" src="~/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="~/js/sdmenu.js"></script>
        <script type="text/javascript" src="~/js/laydate/laydate.js"></script>*@
    <link href="~/Scripts/js1/css1/bootstrap.css" rel="stylesheet" />
    <link href="~/Scripts/js1/css1/css.css" rel="stylesheet" />
    <link href="~/Scripts/js1/css1/Site.css" rel="stylesheet" />
    <script src="~/Scripts/js1/js/jquery1.9.0.min.js"></script>
    <script src="~/Scripts/js1/js/bootstrap.min.js"></script>
    <script src="~/Scripts/js1/js/sdmenu.js"></script>
    <script src="~/Scripts/js1/js/laydate/laydate.js"></script>
    @*<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script src="~/Scripts/js1/js/js/jquery-1.8.3.min.js"></script>
        <script src="~/Scripts/js1/js/js/raphael-min.js"></script>
        <script src="~/Scripts/js1/js/js/script.js"></script>*@
    <meta charset="utf-8">
    <title>Bootstrap Admin</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="~/Scripts/lib/bootstrap/css/bootstrap.css" rel="stylesheet" />

    <link href="~/Scripts/stylesheets/theme.css" rel="stylesheet" />
    <link href="~/Scripts/lib/font-awesome/css/font-awesome.css" rel="stylesheet" />

    <script src="~/Scripts/lib/jquery-1.7.2.min.js"></script>
    <!-- Demo page code -->

    <style type="text/css">
        #line-chart {
            height: 300px;
            width: 800px;
            margin: 0px auto;
            margin-top: 1em;
        }

        .brand {
            font-family: georgia, serif;
        }

            .brand .first {
                color: #ccc;
                font-style: italic;
            }

            .brand .second {
                color: #fff;
                font-weight: bold;
            }
    </style>

</head>
<body>
    <div class="navbar">
        <div class="navbar-inner">
            <ul class="nav pull-right">

                <li><a href="#" class="hidden-phone visible-tablet visible-desktop" role="button">Settings</a></li>
                <li id="fat-menu" class="dropdown">
                    <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="icon-user"></i>@Session["Username"]
                        <i class="icon-caret-down"></i>
                    </a>

                    <ul class="dropdown-menu">
                        <li><a tabindex="-1" href="#">My Account</a></li>
                        <li class="divider"></li>
                        <li><a tabindex="-1" class="visible-phone" href="#">Settings</a></li>
                        <li class="divider visible-phone"></li>
                        <li><a tabindex="-1" href="/Home/Login">Logout</a></li>
                    </ul>
                </li>

            </ul>
            <a class="brand">
                <span>
                    <img src="~/1234.jpg" style="width:50px;height:50px; border-radius:25px;cursor:pointer" onclick="fun()" />
                </span><span class="first" style="font-family:华文彩云;font-size:22px">千  里  马  </span>&nbsp;&nbsp;<span class="second " style="font-size:22px;">   E R P</span>
            </a>
        </div>
    </div>
    <div class="header">


        <div class="header-right">


            
        </div>
    </div>
    @*<script>
            function Cus_Add()
            {
                $.ajax({
                    Type: "post",
                    Url: "/Custom_Info/Custom_Info_Add",
                    data: {
                        Name: $("input['name=Custom_Info_Name']").val(),
                        Nick: $("input['name=Custom_Info_Nick']")
                    }
                })
            }
        </script>*@
    <!-- 顶部 -->

    <div id="middle">
        <div class="left">
            <div class="sidebar-nav">
                <a href="#dashboard-menu" class="nav-header" data-toggle="collapse"><i class="icon-dashboard"></i>基础信息</a>
                <ul id="dashboard-menu" class="nav nav-list collapse in">
                    <li><a href="/Client/Client_Show">客户管理</a></li>
                    <li><a href="/Provider/Provider_show">快递公司</a></li>
                    <li><a href="/Experss/Experss_Show">供应商</a></li>
                    <li><a href="/Express_mate/Exress_mate_Show">快递匹配</a></li>
                    <li><a href="/calendar/calendar_Show">仓库</a></li>
                    <li><a href="/Inventory/ShowInventory">库存管理</a></li>
                </ul>

                <a href="#accounts-menu" class="nav-header" data-toggle="collapse"><i class="icon-briefcase"></i>商品管理</a>
                <ul id="accounts-menu" class="nav nav-list collapse">
                    <li><a href="/Blurb/Blurb_Show">商品信息</a></li>
                    @*<li><a href="/Brand/Brand_Show">商品品牌</a></li>
                        <li><a href="/Category/Category_Show">商品分类</a></li>
                        <li><a href="/Report/Report_Show">商品报表</a></li>*@
                </ul>

                <a href="#error-menu" class="nav-header collapsed" data-toggle="collapse"><i class="icon-exclamation-sign"></i>订单管理@*<i class="icon-chevron-up"></i>*@</a>
                <ul id="error-menu" class="nav nav-list collapse">
                    <li><a href="/Order/Order_Show">新增订单</a></li>
                    <li><a href="/Order/Order_details">订单信息</a></li><li><a href="/Order/SelShow">订单报表</a></li>

                </ul>

                <a href="#legal-menu" class="nav-header" data-toggle="collapse"><i class="icon-legal"></i>采购管理</a>
                <ul id="legal-menu" class="nav nav-list collapse">
                    <li><a href="/Procurement/Procurement_Show">采购订单</a></li>
                    <li><a href="/Stock/Stock_Show">入库信息</a></li>
                </ul>

                <a href="#leaf-menu" class="nav-header" data-toggle="collapse"><i class="icon-leaf"></i>系统设置</a>
                <ul id="leaf-menu" class="nav nav-list collapse">
                    <li><a href="/Shop/Shop_Show">店铺管理</a></li>
                    <li><a href="/Account/Account_Show">账号管理</a></li>
                </ul>
                @*<a href="help.html" class="nav-header"><i class="icon-question-sign"></i>店铺管理</a>
                    <a href="faq.html" class="nav-header"><i class="icon-comment"></i>账号管理</a>*@
            </div>

        </div>
        <div class="Switch"></div>
        <script type="text/javascript">
            $(document).ready(function (e) {
                $(".Switch").click(function () {
                    $(".left").toggle();

                });
            });
        </script>

        <div class="right" id="mainFrame">

            <div class="right_cont">
                <ul class="breadcrumb">
                    当前位置：
                    <a href="/Home/Index">首页</a>
                    <span class="divider">/</span>
                    订单报表
                </ul>
                <div class="title_right"><strong>订单报表</strong></div>
                <div style="width:100%; margin:auto">
                    <div>
                        <table>
                            <tr>
                                <td>
                                    当前年：<input type="text" name="YearTime" style="width:100px;height:15px;" />
                                </td>
                                <td>
                                    当前月：<input type="text" name="MonthTime" style="width:100px;height:15px;" />
                                </td>
                                <td>搜索条件：
                                    <select id="Select1" style="width:60px;">
                                        <option value="年">年</option>
                                        <option value="月">月</option>
                                        <option value="日">日</option>
                                    </select>
                                </td>
                                <td>下单时间：</td>
                                <td>从：<input type="text" name="StartTime" style="width:50px;height:15px;" /></td>
                                <td>到：<input type="text" name="End_Time" style="width:50px;height:15px;" /></td>     
                                <td>&nbsp;&nbsp;&nbsp;<button type="button" style="height: 35px;" class="btn btn-default" onclick="Sel()"><span class="icon-search"></span>查询 </button></td>
                            </tr>
                        </table>
                    </div>
                    <div style="margin-top:20px;">
                        <table class="table  table-hover table-bordered table-striped" id="OrderReport">
                            <thead>
                                <tr>
                                    <th>下单时间</th>
                                    <th>总金额(元)</th>
                                </tr>
                            </thead>
                            <tbody></tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 底部 -->
    <div id="footer">版权所有：千里马ERP</div>



    <script>
        !function () {
            laydate.skin('molv');
            laydate({ elem: '#Calendar' });
        }();
        function fun() {
            location.href = '/Home/Index';
        }
        function Sel() {
            var Start = $("[name=StartTime]").val();
            var End = $("[name=End_Time]").val();
            var Year = $("[name=YearTime]").val();
            var Month = $("[name=MonthTime]").val();
            var aa = $("#Select1").val();
            $("#OrderReport tbody").html("");
            if (Start != "" && End != "") {
                if (aa == "年") {
                    $.ajax({
                        url: "/Order/SelYear",
                        type: "get",
                        cache: false,
                        data: {
                            StartTime: Start,
                            EndTime:End
                            },
                        success: function (data) {
                            $(data).each(function (index, item) {
                                var apen = "<tr><td>" + item.Tdate + "" + aa + "</td><td>" + item.SumMoney + "</td></tr>";
                                $("#OrderReport tbody").append(apen);
                            });
                        }
                    });
                }
                if (aa == "月") {
                    if (Year == "") {
                        alert("请填写年份");
                        return;
                    }
                    $.ajax({
                        url: "/Order/SelMonth",
                        type: "post",
                        data: {
                            StartTime: Start,
                            EndTime: End,
                            YearTime:Year
                        },
                        success: function (data) {
                            $(data).each(function (index, item) {
                                var apen = "<tr><td>" + item.Tdate + "" + aa + "</td><td>" + item.SumMoney + "</td></tr>";
                                $("#OrderReport tbody").append(apen);
                            });
                        }
                    });
                }
                if (aa == "日") {
                    if (Year == "" || Month == "") {
                        alert("年份或月份不为空");
                        return;
                    }
                    $.ajax({
                        url: "/Order/SelDay",
                        type: "post",
                        data: {
                            StartTime: Start,
                            EndTime: End,
                            YearTime: Year,
                            MonthTime:Month
                        },
                        success: function (data) {
                            $(data).each(function (index, item) {
                                var apen = "<tr><td>" + item.Tdate + "" + aa + "</td><td>" + item.SumMoney + "</td></tr>";
                                $("#OrderReport tbody").append(apen);
                            });
                        }
                    });
                } 
            }
            else {
                End = Start;
                //循环取每年总金额
                if (aa == "年") {
                    $.ajax({
                        url: "/Order/SelYear",
                        type: "get",
                        cache: false,
                        data: {
                            StartTime: Start,
                            EndTime: End
                        },
                        success: function (data) {
                            $(data).each(function (index, item) {
                                var apen = "<tr><td>" + item.Tdate + "" + aa + "</td><td>" + item.SumMoney + "</td></tr>";
                                $("#OrderReport tbody").append(apen);
                            });
                        }
                    });
                }
                if (aa == "月") {
                    $.ajax({
                        url: "/Order/SelMonth",
                        type: "post",
                        data: {
                            StartTime: Start,
                            EndTime: End,
                            YearTime: Year
                        },
                        success: function (data) {
                            $(data).each(function (index, item) {
                                var apen = "<tr><td>" + item.Tdate + "" + aa + "</td><td>" + item.SumMoney + "</td></tr>";
                                $("#OrderReport tbody").append(apen);
                            });
                        }
                    });
                }
                if (aa == "日") {
                    $.ajax({
                        url: "/Order/SelDay",
                        type: "post",
                        data: {
                            StartTime: Start,
                            EndTime: End,
                            YearTime: Year,
                            MonthTime: Month
                        },
                        success: function (data) {
                            $(data).each(function (index, item) {
                                var apen = "<tr><td>" + item.Tdate + "" + aa + "</td><td>" + item.SumMoney + "</td></tr>";
                                $("#OrderReport tbody").append(apen);
                            });
                        }
                    });
                }
            }
            
        };
    </script>

</body>
</html>

